//
//  KKAdviceCell.m
//  DoMi
//
//  Created by 康凯 on 2016/11/23.
//  Copyright © 2016年 kk. All rights reserved.
//

#import "KKAdviceCell.h"

@implementation KKAdviceCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(void)initData:(KKAdviceListM *)data{
    [self.avatar sd_setImageWithURL:[NSURL URLWithString:data.avatar] placeholderImage:[UIImage imageNamed:@"default_avater"]];
    if([KKAppUtils isEmptyString:data.nickname]){
        self.nickname.text=@"匿名";
    }else{
        self.nickname.text=data.nickname;
    }
    float width=[KKAppUtils sizeWithText:data.job font:[UIFont systemFontOfSize:12] maxSize:CGSizeMake(100, 14)].width;
    self.jobWidth.constant=width+5;
    self.job.text=data.job;
    self.title.text=data.introduction;
    self.price.text=[NSString stringWithFormat:@"¥%@/次",data.consultmoney];
    self.label.text=data.expertdomain;
    self.commentCount.text=[NSString stringWithFormat:@"%@%@好评",data.judgerank,@"%"];
}
@end
